package org.example.huawei;

import java.util.Scanner;

/**
 * @author: lynn
 * @Descript:
 * @date: 2021/2/24 22:25
 * @version: 1.0
 */
public class HW2 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String str=sc.nextLine();
        String s=sc.nextLine();
        int count=0;
        for (int i = 0; i <str.length() ; i++) {
            if (s.equalsIgnoreCase(String.valueOf(str.charAt(i)))) count++;
        }
        System.out.println(count);
    }
}
